The getPositions method returns an array of Position objects representing all open positions.
var getPositions(symbol, positionType);
symbol
String value representing a symbol for which to return positions. Specify null to return an array for all symbols.
positionType
One of the position types. Specify null to return an array for all position types.
This method returns an array of Position objects.
The following example demonstrates the use of getPositions() method.
function start()
{
//retrieve short positions for all symbols
var account = getAccount();
var positions = account.getOrders(null, POSITIONTYPE_SHORT);
//loop through all positions
for(var i = 0; i < positions.length, i++)
{
//proceed further...
var position = positions[i];
}
}
start(), getAccount(), Position class
Copyright © 2006-2009 ActiveTick LLC